-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quality of life string conversions for FgaObject #149
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
❌ Your project status has failed because the head coverage (25.69%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #149 +/- ##
==========================================
- Coverage 25.71% 25.69% -0.03%
==========================================
Files 104 104
Lines 12582 12595 +13
==========================================
Hits 3236 3236
- Misses 9075 9088 +13
Partials 271 271 ☔ View full report in Codecov by Sentry. |
I am not so familiar with mustache so I was not able to update the sdk-generator |
Hi @FedotCompot - thanks for adding this. We'll take a look Monday or sometime early next week. Most likely we'll have to move these out to their own utility file as the way they're modified here is incompatible with the generation - but we'll have better feedback after a closer look. |
Ping? 👉👈😅 |
👋🏻 Sorry for the delay @FedotCompot, as Raghd mentioned the I think what we'd be best doing is adding a new file alongside these that holds things like this, we have https://github.com/openfga/go-sdk/blob/b22acefa83636a9465c4a0c6734a4a31b5cd8e1f/utils.go but I'm not sure if that's the right place. Maybe a |
I think |
Quality of life functions for
FgaObject
from and tostring
convesionUsing FGA on the backend, I found myself converting a lot between the two so I implemented these easy but handy helper functions. Also as a bonus makes
FgaObject
compatible withfmt.Stringer interface
func (o FgaObject) String() string
func FgaObjectFromString(s string) (*FgaObject, error)
Description
References
Review Checklist
main
If you haven't done so yet, we would appreciate it if you could star the OpenFGA repository. :)